package com.qf.mq;

import com.qf.service.DocService;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;
import com.qianfeng.smsplatform.common.model.Standard_Submit;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

/*
 * @Data: 2021/7/22 22:02
 * */
@Component
public class ReceiveReportListener {

    private DocService docService;
    @Autowired
    public void setDocService(DocService docService) {
        this.docService = docService;
    }
    @RabbitListener(queues = RabbitMqConsants.TOPIC_UPDATE_SMS_REPORT)
    public void update(Standard_Submit submit) throws IOException {
        System.out.println("收到更新日志的消息了"+submit);
        docService.updateDoc(submit);
    }


}
